﻿using System;

using JetBrains.ReSharper.Daemon;
using JetBrains.ReSharper.Psi.CSharp.Tree;

namespace FinlogiK.ReSharperContrib
{
	[ConfigurableSeverityHighlighting("MissingStaticQualifier", OverlapResolve = OverlapResolveKind.NONE, ToolTipFormatString = "Qualifier is missing")]
	internal sealed class AddStaticQualifierHighlight : IHighlighting
	{
		#region Fields

		private readonly IReferenceExpression _referenceExpression;

		#endregion

		#region Constructors

		internal AddStaticQualifierHighlight(IReferenceExpression referenceExpression)
		{
			this._referenceExpression = referenceExpression;
		}

		#endregion

		#region Properties

		internal IReferenceExpression ReferenceExpression
		{
			get
			{
				return this._referenceExpression;
			}
		}

		#endregion

		#region IHighlighting Members

		public string ErrorStripeToolTip
		{
			get
			{
				return this.ToolTip;
			}
		}

		public int NavigationOffsetPatch
		{
			get
			{
				return 0;
			}
		}

		public string ToolTip
		{
			get
			{
				return "A reference to a static member should be preceded by a static qualifier.";
			}
		}

		public bool IsValid()
		{
			return this._referenceExpression.IsValid();
		}

		#endregion
	}
}